﻿using DevExpress.XtraEditors;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace ProjectModule
{
    public partial class FormProjectNameInput : DevExpress.XtraEditors.XtraForm
    {
        public string ProjectName
        {
            get;
            set;
        }
        public FormProjectNameInput()
        {
            InitializeComponent();
        }

        private void simpleButton1_Click(object sender, EventArgs e)
        {
            if (textBoxProjectName.Text == "")
            {
                MessageBox.Show("请输入项目名称");
                textBoxProjectName.Focus();
                return;
            }
            ProjectName = textBoxProjectName.Text;
            DialogResult = DialogResult.OK;
        }

        private void FormProjectNameInput_FormClosing(object sender, FormClosingEventArgs e)
        {
            if (e.CloseReason == CloseReason.UserClosing)
            {
                DialogResult = DialogResult.No;
                return;
            }
            if (textBoxProjectName.Text == "")
            {
                MessageBox.Show("请输入项目名称");
                textBoxProjectName.Focus();
                e.Cancel = true;
                return;
            }
        }
    }
}